
オブジェクトの変換(SITransformation)を設定したり、戻したりします。
現時点では、現在の時間以外の時刻に変換を設定することはできません。時間を越えて変換されるようにするには、KinematicStateオブジェクトのパラメータをアニメートする必要があります。
注:Python ではプロパティでの入力パラメータがサポートされていないため、このプロパティは
Python互換ではありません。代わりにKinematicState.GetTransform2およびKinematicState.PutTransform2を使用してください。
警告:戻された SITransformation
オブジェクトには変換値のコピーが含まれるので、このオブジェクトの状態を変更しても、元のオブジェクトには反映されません。オブジェクトのキネマティクス状態を変更するには、以下に示すように、変更された
SITransformation オブジェクトを使用してこのプロパティを設定する必要があります。
| パラメータ | タイプ | 詳細 |
|---|---|---|
| Frame | Variant | 変換を取得するフレーム。 |
/*
This example shows how to modify the state of a transform
when you are working on a copy of the object.
*/
NewScene (null, false);
var oRoot = Application.ActiveSceneRoot;
var oCube = oRoot.AddGeometry("Cube", "MeshSurface", "Cube");
// Retrieve a copy of the transform object
var oTrans = oCube.Kinematics.Local.Transform;
var oMat4 = XSIMath.CreateMatrix4();
oMat4.Set( 1.0, 1.0, 0.0, 10.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 );
// Warning: you cannot change the object's transform like this:
// oCube.Kinematics.Local.Transform.SetMatrix4(oMat4);
// because this will only modify a copy of the transform object
// not the real state of oCube.Kinematics.Local.Transform
oTrans.SetMatrix4(oMat4);
// Replace the transform with the modified copy
oCube.Kinematics.Local.Transform = oTrans;
|
set oCube = Application.ActiveProject.ActiveScene.Root.AddGeometry("Cube","MeshSurface")
oCube.Kinematics.Global.Parameters("posy").Value = 4.0
set oLocalTrans = oCube.Kinematics.Local.Transform
set oVec3 = XSIMath.CreateVector3
oLocalTrans.GetTranslation oVec3
oVec3.y = oVec3.y - 2.0
oLocalTrans.SetTranslation oVec3
' Change the object's translation by setting
' the modified SITransformation back
oCube.Kinematics.Local.Transform = oLocalTrans
|